<template>
  <NuxtLink class="app-video" :to="`/video/${data.bvid}`">
    <div class="app-video__top">
      <img :src="data.pic" alt="" />
      <div class="line">
        <span>
          <i class="iconfont icon_shipin_bofangshu"></i>
          {{ data.stat.view }}
        </span>
        <span>
          <i class="iconfont icon_shipin_danmushu"></i>
          {{ data.stat.danmaku }}
        </span>
      </div>
    </div>
    <div class="app-video__bottom">{{ data.title }}</div>
  </NuxtLink>
</template>

<script lang="ts" setup>
const props = defineProps<{
  data: any;
}>();
</script>

<style lang="scss" scoped>
.app-video {
  display: inline-flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 10px 5px;
  width: 50%;

  &__top {
    position: relative;
    height: 100px;
    background-color: red;

    img {
      display: block;
      width: 100%;
      height: 100%;
    }

    .line {
      position: absolute;
      box-sizing: border-box;
      padding: 0 10px;
      width: 100%;
      bottom: 0;
      display: flex;
      justify-content: space-between;
      height: 32px;
      line-height: 32px;
      color: #fff;
      background-color: rgba(0, 0, 0, 0.5);
    }
  }

  &__bottom {
    height: 32px;
    line-height: 16px;
    font-size: 12px;
    color: #000;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
  }
}
</style>
